package com.rosense.srpingboot.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.rosense.srpingboot.entity.UserEntity;
import com.rosense.srpingboot.entity.UserLog;
import com.rosense.srpingboot.service.IUserService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;

/**
 * 
 * @author 李岩飞
 * @email eliyanfei@126.com
 * @date 2018年3月10日 下午6:12:26
 */
@Controller
@Api(tags = "用户管理")
@RequestMapping(value = "user")
public class UserController {
	@Autowired
	IUserService userService;

	@ApiOperation(value = "用户列表")
	@RequestMapping(value = "list", method = RequestMethod.POST)
	@ResponseBody
	public List<UserEntity> list() {
		return userService.list();
	}

	@ApiOperation(value = "日志列表")
	@RequestMapping(value = "listlog", method = RequestMethod.POST)
	@ResponseBody
	public List<UserLog> listlog() {
		return userService.listlog();
	}

	@ApiOperation(value = "删除用户")
	@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "String")
	@RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
	@ResponseBody
	public Object delete(@PathVariable("id") String id) {
		System.out.println(id);
		return null;
	}
}
